package cn.kgc.vue.mapper;

import cn.kgc.vue.entity.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author 11839
* @description 针对表【sys_course】的数据库操作Mapper
* @createDate 2024-06-28 15:23:44
* @Entity cn.kgc.vue.entity.Course
*/

public interface CourseMapper extends BaseMapper<Course> {

    @Select("select * FROM sys_course where course_no=#{courseNo} or course_name=#{courseName}")
    Course select(@Param("courseName") String courseName, @Param("courseNo") String courseNo);

    @Select("SELECT * FROM sys_course")
    List<Course> selectAllIncludingDeleted();

    @Select("SELECT * FROM sys_course where id=#{courseNo}")
    Course selectAllIncludingDeletedById(Integer courseNo);

    @Update("UPDATE sys_course SET course_name=#{courseName}, course_no=#{courseNo},is_delete=0 WHERE id=#{id}")
    void idUpdate(@Param("courseName") String courseName, @Param("courseNo") String courseNo, @Param("id") Integer id);

}




